Skip to content

Merging to release-5.8: [TT-15100][TT-15091] adjusted swagger enum and tyk vendor extension schema name (#7535)#7537

Merged
lghiur merged 1 commit intorelease-5.8from
merge/release-5.8/b091f91b6e275b0a5960e52fff9341a49062bfa5/TT-15100
Nov 14, 2025
Merged

Merging to release-5.8: [TT-15100][TT-15091] adjusted swagger enum and tyk vendor extension schema name (#7535)#7537
lghiur merged 1 commit intorelease-5.8from
merge/release-5.8/b091f91b6e275b0a5960e52fff9341a49062bfa5/TT-15100

Conversation

@probelabs
Copy link
Copy Markdown
Contributor

@probelabs probelabs Bot commented Nov 13, 2025

[TT-15100][TT-15091] adjusted swagger enum and tyk vendor extension schema name (#7535)

  • Schema XTykApiGateway is renamed to TykVendorExtension in the schemas
    section
  • All $ref references to XTykApiGateway are updated to reference
    TykVendorExtension
  • BooleanQueryParam schema has enum removed while preserving type:
    boolean
  • All inline boolean parameter enums are removed from the specification

Ticket Details

TT-15100
Status In Code Review
Summary Tyk Dashboard Swagger YAML Schema Discrepancy

Generated at: 2025-11-13 12:19:58

…chema name (#7535)

- Schema XTykApiGateway is renamed to TykVendorExtension in the schemas
section
- All $ref references to XTykApiGateway are updated to reference
TykVendorExtension
- BooleanQueryParam schema has enum removed while preserving type:
boolean
- All inline boolean parameter enums are removed from the specification
<!---TykTechnologies/jira-linter starts here-->

### Ticket Details

<details>
<summary>
<a href="https://tyktech.atlassian.net/browse/TT-15100" title="TT-15100"
target="_blank">TT-15100</a>
</summary>

|         |    |
|---------|----|
| Status  | Ready for Dev |
| Summary | Tyk Dashboard Swagger YAML Schema Discrepancy |

Generated at: 2025-11-12 09:34:58

</details>

<!---TykTechnologies/jira-linter ends here-->

(cherry picked from commit b091f91)
@github-actions
Copy link
Copy Markdown
Contributor

Swagger Changes










  
  
  
  
  
  
  
  
  
  
     _        __  __
    TykVendorExtension:
    enum:
    enum:
    enum:
    enum:
    enum:
    enum:
    enum:
   _| |_   _ / _|/ _|  between swagger-prev.yml
  + one list entry added:
  + one list entry added:
  + one list entry added:
  + one list entry added:
  + one list entry added:
  + one map entry added:
  - one list entry removed:
  - one list entry removed:
  - one list entry removed:
  - one list entry removed:
  - one list entry removed:
  - one map entry removed:
  - one map entry removed:
  - one map entry removed:
  - one map entry removed:
  - one map entry removed:
  - one map entry removed:
  - one map entry removed:
 / _' | | | | |_| |_       and swagger-current.yml
 \__,_|\__, |_| |_|   returned 13 differences
components.schemas
components.schemas.BooleanQueryParam
components.schemas.TraceRequest.properties.oas.oneOf
paths./tyk/apis/oas.get.responses.200.content.application/json.schema.items.allOf
paths./tyk/apis/oas.post.requestBody.content.application/json.schema.allOf
paths./tyk/apis/oas/{apiID}.get.responses.200.content.application/json.schema.allOf
paths./tyk/apis/oas/{apiID}.put.requestBody.content.application/json.schema.allOf
paths./tyk/keys.post.parameters.hashed.schema
paths./tyk/keys/{keyID}.delete.parameters.hashed.schema
paths./tyk/keys/{keyID}.get.parameters.hashed.schema
paths./tyk/keys/{keyID}.post.parameters.hashed.schema
paths./tyk/keys/{keyID}.put.parameters.hashed.schema
paths./tyk/reload.get.parameters.block.schema
| (_| | |_| |  _|  _|

@github-actions
Copy link
Copy Markdown
Contributor

API Changes

no api changes detected

@github-actions
Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Require and restrict extension object

Tighten TykVendorExtension by marking x-tyk-api-gateway as required and disallowing
extra fields. This prevents empty or malformed extension objects from passing
validation.

swagger.yml [8170-8174]

 TykVendorExtension:
+  type: object
   properties:
     x-tyk-api-gateway:
       $ref: '#/components/schemas/XTykAPIGateway'
-  type: object
+  required:
+    - x-tyk-api-gateway
+  additionalProperties: false
Suggestion importance[1-10]: 7

__

Why: The snippet corresponds to new lines 8170-8174 defining TykVendorExtension. Requiring x-tyk-api-gateway and disallowing extra fields is accurate, directly applicable, and meaningfully strengthens schema validation without conflicting with the PR.

Medium
Disambiguate oneOf selection

Verify that TykVendorExtension cannot be confused with a full OAS schema in oneOf.
Add a discriminator or mutually exclusive required properties so validation reliably
distinguishes the two branches.

swagger.yml [7751-7753]

 oas:
   oneOf:
     - $ref: 'https://raw.githubusercontent.com/TykTechnologies/tyk/refs/heads/master/apidef/oas/schema/3.0.json'
     - $ref: '#/components/schemas/TykVendorExtension'
+  discriminator:
+    propertyName: x-tyk-api-gateway
Suggestion importance[1-10]: 6

__

Why: The existing_code matches lines 7751-7753 under oas.oneOf. Adding a discriminator or mutually exclusive required fields can improve validation clarity, though it may require broader schema changes and isn't strictly necessary for correctness.

Low
Possible issue
Constrain vendor extension schema

Ensure TykVendorExtension is compatible with the allOf composition where the other
schema is a full OAS document. Constrain TykVendorExtension to only allow the vendor
extension key by using additionalProperties: false to avoid unintended schema
merging.

swagger.yml [748]

+- $ref: '#/components/schemas/TykVendorExtension'
 
-
Suggestion importance[1-10]: 5

__

Why: The snippet matches new line 748 referencing TykVendorExtension. The advice to restrict with additionalProperties: false is reasonable but not shown in improved_code and is a general validation hardening, not critical.

Low

@sonarqubecloud
Copy link
Copy Markdown

@lghiur lghiur merged commit 902eb2a into release-5.8 Nov 14, 2025
41 of 42 checks passed
@lghiur lghiur deleted the merge/release-5.8/b091f91b6e275b0a5960e52fff9341a49062bfa5/TT-15100 branch November 14, 2025 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant